home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 4 / Mac Giga-ROM 4.0 - 1993.toast / FILES / SYS / SystemHack-replace.sea / Replace-Existing Hacks
Encoding:
Text File  |  1992-08-05  |  2.7 KB  |  60 lines  |  [TEXT/AOqc]

  1.  
  2.  
  3.  
  4.  
  5. If you have ever been annoyed at having to reach for the mouse to respond to the “Replace existing fubar?” dialog, here are some ways to fix it with ResEdit.  Before giving the recipes, I should mention that responsible experts always say that you should only use ResEdit on a *copy* of your System file, not the one that is in use.  Personally, I don’t bother, but don’t say you weren’t warned.
  6.  
  7.  
  8. System 6
  9.  
  10. Open the ALRT -3996 resource in the System.  Select “Set 'ALRT' Stage Info…” from the menu.  In the resulting dialog box, change the radio buttons to indicate that Cancel, rather than OK, is the default button at each stage.
  11.  
  12.  
  13. System 7
  14.  
  15. For our first hack, we have a way to make Replace rather than Cancel be the default button.  First, edit the DITL -6045 resource.  Click on the Cancel button, then select “Set item number…” from the menu and change the number from 2 to 1.  Close the DITL editor, and open the PACK 3 resource.  ResEdit will warn you that this resource is compressed and editing it will decompress it, but never mind that.  Normally you will get the hex editor, but if you happen to have the CODE editor installed in your copy of ResEdit, you may have to open the hex editor manually.  Anyway, find offset 9F0, and change 5340 to 5540.  (If what you see at offset 9F0 is not 5340, all bets are off.)  Close the System and save changes.
  16.  
  17. Second, there is a hack by Elizabeth Wylie that leaves the buttons alone, but lets you Save with the option key pressed and replace the existing file without even seeing the dialog.  Open the PACK 3 resource with the hex editor.  At offset 9EC, change 6100 16B0 to 6100 2B2A.  At the end of the resource, append:
  18. 1038 017B 0800 0002
  19. 6700 0006 7001 4E75
  20. 61FF FFFF EB74 4E75
  21. Close and save changes.
  22.  
  23. Finally, you could use both hacks, with one minor change to the second hack:  Where you see 7001 above, use 7002 instead.
  24.  
  25.  
  26.  
  27. For programmers, here’s the disassembly of the PACK 3 hacks.  The first hack replaces
  28.  SUBQ.W  #$1, D0
  29. with
  30.  SUBQ.W        #$2, D0
  31. This instruction is followed by a test of whether D0 is zero or not.
  32.  
  33. The second hack replaces
  34.   BSR     *+$16B2      ; 0000209E
  35. with
  36.   BSR     *+$2B2C      ; 00003518 
  37. and appends
  38.   move.B  $017B, D0    ; Get the byte at KeyMap + 7.
  39.   btst    #$02, D0     ; Is the option key down?
  40.   beq     *+$0008      ; If not, do usual stuff
  41.   moveQ   #$01, D0     ; If so, skip the dialog.
  42.   RTS
  43.  
  44.   bsr.L   *-$0000148A  ; 0000209E
  45.   RTS
  46.  
  47. In the combination hack, the part that’s appended would have to say
  48.   move.B  $017B, D0    ; Get the byte at KeyMap + 7.
  49.   btst    #$02, D0     ; Is the option key down?
  50.   beq     *+$0008
  51.   moveQ   #$02, D0     ; If so, skip the dialog.
  52.   RTS
  53.  
  54.   bsr.L   *-$0000148A  ; 0000209E
  55.   RTS
  56.  
  57.  
  58. James W. Walker, July 1992
  59. CIS: 76367,2271
  60. AOL: JWWalker